export default class {
  //#region 党群中心宣传
  getPropagandList(params) {
    return this.request({
      url: "/api/admin/party/partypublicity/",
      method: "GET",
      params,
    });
  }
  addPropagand(data) {
    return this.request({
      url: `/api/admin/party/partypublicity/`,
      method: "POST",
      data,
    });
  }
  editPropagand(id, data) {
    return this.request({
      url: `/api/admin/party/partypublicity/${id}/`,
      method: "PUT",
      data,
    });
  }
  delPropagand(id) {
    return this.request({
      url: `/api/admin/party/partypublicity/${id}/`,
      method: "DELETE",
    });
  }
  //#endregion
  //#region 平战结合体系
  getFlatWarList(params) {
    return this.request({
      url: "/api/admin/party/atlas/",
      method: "GET",
      params,
    });
  }
  addFlatWar(data) {
    return this.request({
      url: `/api/admin/party/atlas/`,
      method: "POST",
      data,
    });
  }
  editFlatWar(id, data) {
    return this.request({
      url: `/api/admin/party/atlas/${id}/`,
      method: "PUT",
      data,
    });
  }
  delFlatWar(id) {
    return this.request({
      url: `/api/admin/party/atlas/${id}/`,
      method: "DELETE",
    });
  }
  //#endregion
  //#region 红色路线
  getRedWandersList(params) {
    return this.request({
      url: "/api/admin/party/redline/",
      method: "GET",
      params,
    });
  }
  addRedWanders(data) {
    return this.request({
      url: `/api/admin/party/redline/`,
      method: "POST",
      data,
    });
  }
  editRedWanders(id, data) {
    return this.request({
      url: `/api/admin/party/redline/${id}/`,
      method: "PUT",
      data,
    });
  }
  delRedWanders(id) {
    return this.request({
      url: `/api/admin/party/redline/${id}/`,
      method: "DELETE",
    });
  }
  //#endregion
  //#region 畲乡介绍
  getSheIntroduceList(params) {
    return this.request({
      url: "/api/admin/party/shexiang_introduce/",
      method: "GET",
      params,
    });
  }
  addSheIntroduce(data) {
    return this.request({
      url: `/api/admin/party/shexiang_introduce/`,
      method: "POST",
      data,
    });
  }
  editSheIntroduce(id, data) {
    return this.request({
      url: `/api/admin/party/shexiang_introduce/${id}/`,
      method: "PUT",
      data,
    });
  }
  delSheIntroduce(id) {
    return this.request({
      url: `/api/admin/party/shexiang_introduce/${id}/`,
      method: "DELETE",
    });
  }

  getSheRecommendList(params) {
    return this.request({
      url: "/api/admin/party/shexiang_recummend/",
      method: "GET",
      params,
    });
  }
  addSheRecommend(data) {
    return this.request({
      url: `/api/admin/party/shexiang_recummend/`,
      method: "POST",
      data,
    });
  }
  editSheRecommend(id, data) {
    return this.request({
      url: `/api/admin/party/shexiang_recummend/${id}/`,
      method: "PUT",
      data,
    });
  }
  delSheRecommend(id) {
    return this.request({
      url: `/api/admin/party/shexiang_recummend/${id}/`,
      method: "DELETE",
    });
  }
  //#endregion

  // 获取所有党建资讯列表
  getPartyNewsList(id, params) {
    return this.request({
      url: `/admin/v1/party_buliding_news/list?news_type_id=${id}`,
      method: "GET",
      params,
    });
  }

  // 获取党建资讯详情
  getPartyNewsDetail(id) {
    return this.request({
      url: `/admin/v1/party_buliding_news?id=${id}`,
      method: "GET",
    });
  }

  addPartyNews(data) {
    return this.request({
      url: `/admin/v1/party_buliding_news`,
      method: "PUT",
      data,
    });
  }
  editPartyNews(data) {
    return this.request({
      url: `/admin/v1/party_buliding_news`,
      method: "POST",
      data,
    });
  }

  deletePartyNews(id) {
    return this.request({
      url: `/admin/v1/party_buliding_news?id=${id}`,
      method: "DELETE",
    });
  }

  // 支部人员信息
  getZhibuLit(params) {
    return this.request({
      url: "/api/admin/party/personinfo/",
      method: "GET",
      params,
    });
  }

  addZhibuMember(data) {
    return this.request({
      url: "/api/admin/party/personinfo/",
      method: "POST",
      data,
    });
  }

  editZhibuMember(id, data) {
    return this.request({
      url: `/api/admin/party/personinfo/${id}/`,
      method: "PATCH",
      data,
    });
  }
  delZhibuMember(id) {
    return this.request({
      url: `/api/admin/party/personinfo/${id}/`,
      method: "DELETE",
    });
  }

  //#region 党员管理
  // 党建类别
  getPartyType() {
    return this.request({
      url: `/admin/v1/party_user/type`,
      method: "GET",
    });
  }

  getPartyMemberList(id, params) {
    return this.request({
      url: `/admin/v1/party_user/list?party_user_type_id=${id}`,
      method: "GET",
      params,
    });
  }
  addPartyMember(data) {
    return this.request({
      url: `/admin/v1/party_user`,
      method: "PUT",
      data,
    });
  }
  editPartyMember(id, data) {
    return this.request({
      url: `/admin/v1/party_user?id=${id}`,
      method: "POST",
      data,
    });
  }
  delPartyMember(id) {
    return this.request({
      url: `/admin/v1/party_user/id=${id}`,
      method: "DELETE",
    });
  }
  //#endregion
  //#region 党建志愿者招募
  // 志愿者
  getVolunteerRosterList(params) {
    return this.request({
      url: "/api/admin/party_volunteer/apply/",
      method: "GET",
      params,
    });
  }
  getVolunteerRosterInfo(id) {
    return this.request({
      url: `/api/admin/party_volunteer/apply/${id}/`,
      method: "GET",
    });
  }
  setVolunteerRosterStatus(id, data) {
    return this.request({
      url: `/api/admin/party_volunteer/apply/${id}/`,
      method: "PUT",
      data,
    });
  }
  // 志愿者组织
  getVoluntGroupList(params) {
    return this.request({
      url: "/api/admin/party_volunteer/group/",
      method: "GET",
      params,
    });
  }
  addVoluntGroup(data) {
    return this.request({
      url: `/api/admin/party_volunteer/group/`,
      method: "POST",
      data,
    });
  }
  editVoluntGroup(id, data) {
    return this.request({
      url: `/api/admin/party_volunteer/group/${id}/`,
      method: "PUT",
      data,
    });
  }
  delVoluntGroup(id) {
    return this.request({
      url: `/api/admin/party_volunteer/group/${id}/`,
      method: "DELETE",
    });
  }
  // 入组审核
  getJoinVoluntGroupList(params) {
    return this.request({
      url: "/api/admin/party_volunteer/add_group/",
      method: "GET",
      params,
    });
  }
  getJoinVoluntGroupInfo(id) {
    return this.request({
      url: `/api/admin/party_volunteer/add_group/${id}/`,
      method: "GET",
    });
  }
  setJoinVoluntGroupStatus(id, data) {
    return this.request({
      url: `/api/admin/party_volunteer/add_group/${id}/`,
      method: "PUT",
      data,
    });
  }
  //#endregion
  //#region 党建志愿者活动
  getVoluntActivityList(params) {
    return this.request({
      url: "/api/admin/party_volunteer/activity/",
      method: "GET",
      params,
    });
  }
  addVoluntActivity(data) {
    return this.request({
      url: `/api/admin/party_volunteer/activity/`,
      method: "POST",
      data,
    });
  }
  editVoluntActivity(id, data) {
    return this.request({
      url: `/api/admin/party_volunteer/activity/${id}/`,
      method: "PUT",
      data,
    });
  }
  delVoluntActivity(id) {
    return this.request({
      url: `/api/admin/party_volunteer/activity/${id}/`,
      method: "DELETE",
    });
  }
  // 活动签到二维码
  getVoluntActivityCode(id) {
    return this.request({
      url: `/api/admin/party_volunteer_qrcode/${id}`,
      method: "GET",
      responseType: "blob",
      transformResponse: [
        function (data) {
          // 对 data 进行任意转换处理
          return { code: 0, data };
        },
      ],
    });
  }
  // 活动已报名名单
  getVoluntActivityEnlistList(params) {
    return this.request({
      url: "/api/admin/party_volunteer/sign_up/",
      method: "GET",
      params,
    });
  }
  // 活动已签到名单
  getVoluntActivitySignUpList(params) {
    return this.request({
      url: "/api/admin/party_volunteer/sign_in/",
      method: "GET",
      params,
    });
  }
  //#endregion
}
